﻿
using LPP.Entity.Addresses;
using System.ComponentModel.DataAnnotations;

namespace LPP.Entity.AppUser
{
    public class Users
    {
        [Key] // 确保这个属性被标记为主键
        public int UserID { get; set; }
        public string PhoneNumber { get; set; }
        public string Name { get; set; }

        public DateTime CreatedAt { get; set; } = DateTime.Now;
        public bool IsDelete { get; set; } = false; // 默认不删除

        public ICollection<Contact> Contacts { get; set; }
        // 导航属性，表示用户的评论
        public List<UserReview> Reviews { get; set; }
        // 添加导航属性
        public virtual ICollection<LPP.Entity.Orders.Order> Orders { get; set; }

        // 新增的导航属性
        public virtual ICollection<Address> Address { get; set; }
    }

    public class Contact
    {
        public int Id { get; set; }
        public int UserId { get; set; }
        public string ContactName { get; set; }
        public string ContactPhoneNumber { get; set; }

        public Users User { get; set; }
    }
}
